<template>
<view class="yajin">
	<view style="margin-top: 168upx; text-align: center; font-size: 90upx; color: #18a3dc;">0.0</view>
	<view style="margin-top: 80upx; text-align: center; font-size: 32upx; color: #18a3dc;">总余额（元）</view>
	<view style="margin-top: 70upx; text-align: center; font-size: 24upx; color: #666666;">可随时在‘个人中心-我的钱包提现’</view>
	<view @click="jiaona" style="margin: 420upx auto 0; width: 670upx; height: 105upx; line-height: 105upx; text-align: center; font-size: 40upx; background-color: #18a3dc; color: #FFFFFF;">
		充值押金
	</view>
</view>
</template>

<script>
import { HTTP } from '../../http.js';
let http = new HTTP;
export default {
	data() {
		return {
		}
	},
	methods: {
		changeSele(item){
			this.sele=item;
		},
		jiaona(){					
			let user = uni.getStorageSync('user');
			uni.showLoading({ title: '加载中' });
			http.request({
				url: `borrow/zfbPay?openId=${user.zfbUserId}&type=2`,
				method: 'get',
				success: (res)=>{		
					let str=res.dataList||'';
					uni.hideLoading();
					uni.requestPayment({	
						provider: 'alipay',
						orderInfo: str,						
						success: (result)=>{		
							if(result.resultCode==9000){							
								uni.navigateBack({ delta: 1, success: ()=>{
									setTimeout(()=>{								
										uni.showToast({ icon: 'none', title: '支付成功！' })
									},500)	
								} });																
							}
						},
						fail: (err)=>{		
							uni.showToast({ icon: 'none', title: '支付失败！' });		
						}
					});
				},
				fail: ()=>{					
					uni.hideLoading();
				}
			});	
		}
	}
}
</script>

<style>
.yajin {
	height: 100vh;
	position: relative;
	background: #fff;
	overflow: hidden;
}
</style>
